home *** CD-ROM | disk | FTP | other *** search
- 0, In this demonstration, you will see how to use the
- 4, Microsoft Script Debugger. After you've installed
- 7, the Microsoft Script Debugger there are two
- 9, situations where you will use it. First, when you view
- 13, the source of an HTML page the page is displayed
- 16, with the Script Debugger. For example, this is a
- 20, page with three frames on it. I can enter values into
- 23, the text boxes on two of the frames and when I
- 28, click the button on the third frame it reads the
- 31, values from the two text boxes. If there was an error
- 35, in the code I could view the source of this file,
- 42, and the source of the page displays in the
- 45, Microsoft Script Debugger. This is the source for the
- 48, page frameparent.htm. It contains the source file
- 53, for the frames displayed on the page. Using the
- 57, Script Debugger is especially useful for frames
- 60, because the Project Explorer Window displays the
- 63, hierarchy of the pages displayed in the frames. To look at
- 68, the code for one of the pages, I can simply
- 71, double-click on the page. This is the code for the frame
- 75, that contains the command button. I can set a
- 78, break point at one of the lines of code by simply
- 82, clicking in the margin. In order to reach this break
- 86, point, I need to return to Internet Explorer and
- 89, hit the button again. Back in Internet Explorer, if
- 95, I hit the button the break point is reached and
- 100, the Microsoft Script Debugger opens the file with
- 103, the line highlighted that caused the break point.
- 107, Once in break mode the Microsoft Script Debugger
- 110, works like other debuggers you may be familiar with.
- 113, There are buttons that will jump you into lines of
- 115, code, step you over lines of code, and step you
- 119, out of lines of code. There's an Immediate Window
- 122, where you can output the values of variables that
- 126, you're using in your code. For example, we can
- 130, output the value of the text box and see that it is
- 135, "3456." To continue on after you've debugged your
- 139, code simply hit the Continue button. Another use for
- 147, the Script Debugger is finding run-time or
- 149, syntax errors in your script code. If you open a page
- 153, that contains syntax errors, for example,
- 158, "errorpage.htm." This is a page that contains a text box
- 164, and a push button. When I click on the push button
- 167, it should change the value displayed in the text
- 170, box. However, there's errors in this code so when I
- 174, click on the push button you get the regular
- 177, Internet Explorer Script Error dialog. But when you
- 180, select OK the Microsoft Script Debugger starts
- 185, loading the page and has the cursor at the line that
- 189, caused the error. The error in this case is that I
- 195, tried to access the value of a control using the
- 199, Forms Collection when the control itself did not live
- 203, on a form. In the Microsoft Script Debugger you
- 207, are simply looking at a local copy of this HTML
- 210, page, so you can't delete or change the text. You
- 215, have to return to the actual page on the Web server.
- 219, If I tried to delete this text the Microsoft
- 222, Script Debugger displays an error saying that the file
- 225, is actually stored on an HTTP server and so you
- 229, can't edit the file directly. So, in this
- 234, demonstration you have seen that the Microsoft Script
- 237, Debugger is useful for viewing your code and setting
- 240, break points, as well as finding errors in your
- 243, script code.
- 244, END